import { ColorRepresentation, Fog } from "../../thirdparty/three/imports";
import { FogBase3D } from "./FogBase3D";

export interface Fog3D
{
    get _fog(): Fog;
    set _fog(v);
}

export class Fog3D extends FogBase3D
{
    constructor(color: ColorRepresentation, near = 1, far = 1000)
    {
        super();
        this._fog = new Fog(color, near, far);
    }

    static get(fog: Fog)
    {
        let fog3D = this._map.get(fog) as Fog3D;
        if (!fog3D)
        {
            fog3D = new Fog3D(null);
            fog3D._fog = fog;
        }

        return fog3D;
    }
}
